import request from "@/utils/request";
import type { shopCartListModel} from './model/shopCart'
//获取购物车列表数据
export const reqGetShopCartList = ()=>{
  return request.get<any,shopCartListModel>('/cart/cartList')
}
//添加购物车数据
export const reqGetAddShopCart = (skuId:number,skuNum:number)=>{
  // console.log('发送的数据',skuNum);
  
  return request.post<any,null>(`/cart/addToCart/${ skuId }/${ skuNum }`)
}
//切换商品选中状态
export const reqGetCheckCart = (skuId:number,isChecked:number)=>{
  return request.get<any,null>(`/cart/checkCart/${skuId}/${isChecked}`)
}
//删除购物车商品
export const reqGetDeleteCart = (skuId:number)=>{
  return request.delete<any,null>(`/cart/deleteCart/${skuId}`)
}
//批量选中购物车
export const reqGetBatchCheckCart = (isChecked:number,skuIdList:number[])=>{
  return request({
    method:'POST',
    url:`/cart/batchCheckCart/${isChecked}`,
    data:skuIdList
 })
}
//批量删除购物车
export const reqGetBatchDeleteCart = (skuIdList:number[])=>{
  return request({
    method:'POST',
    url:`/cart/batchDeleteCart`,
    data:skuIdList
 })
}
